package com.haierp.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.haierp.model.ShippingTrack;
import com.haierp.service.IShippingTrackService;
import com.haierp.util.JsonPageResult;
import com.wangzhixuan.commons.base.BaseController;


@Controller
@RequestMapping("/shipping")
public class ShippingTrackController extends BaseController {
	@Autowired
	private IShippingTrackService shippingTrackService;
	
	/**
	 * 根据shippingNo查找物流运行轨迹
	 * @param
	 * @return
	 */
	@RequestMapping("/queryByShippingNo")
	@ResponseBody
	public Object queryShippingTrack(String shippingNo) {
		JsonPageResult<List<ShippingTrack>> result = shippingTrackService.queryShippingTrack(shippingNo);	
		return result.buildIsSuccess(true);
	}
	
	/**
	 * 调用100接口根据返回参数将国内快递运输估计写进info字段
	 * @return
	 */
	@RequestMapping("/insertOrUpdateInfo")
	public void insertOrUpdateInfo() {
		shippingTrackService.insertOrUpdateInfo();
	}
}
